package com.crl.map.core
{
	import com.crl.net.ResourceToken;
	import com.crl.net.loader.StreamLoader;
	
	import flash.utils.Dictionary;
	
	public class MapLoaderManager
	{
		private var store:Dictionary
		
		public static var ins:MapLoaderManager;
		public function MapLoaderManager()
		{
			store=new Dictionary();
		}
		
		public function loadBackground(path:String):ResourceToken{
			var token:ResourceToken=store[path];
			if(token==null){
				var token:ResourceToken=new ResourceToken();
				var loader:StreamLoader=new StreamLoader();
				loader.bindToken(token);
				loader.loadPath(path);
				
				store[path]=token;
			}
			return token;
		}
	}
}